package com.cx.config;

import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import org.springframework.web.servlet.view.UrlBasedViewResolver;

import javax.servlet.Filter;
public class servletconfig extends AbstractAnnotationConfigDispatcherServletInitializer {
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{springconfig.class};
    }

    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{springmvcconfig.class};
    }

    protected String[] getServletMappings() {
        return new String[]{"*.do"};
    }

    @Override
    protected Filter[] getServletFilters() {
        CharacterEncodingFilter filter=new CharacterEncodingFilter();
        filter.setEncoding("UTF-8");
        return new Filter[]{filter};
    }
}
